package itheima.zuoye.Test7;

import java.math.BigDecimal;

public class Jin  extends Cad{

    public Jin(String number, String name, String phonenumber, double money) {
        super(number, name, phonenumber, money);
    }
//金卡在支付时享受8折优惠，并且消费满200元可以提供打印免费洗车票的服务。
    @Override
    public BigDecimal pay(BigDecimal amount) {
        BigDecimal discount = new BigDecimal("0.8");
        BigDecimal threshold = new BigDecimal("200");
        BigDecimal result = amount.multiply(discount);
        if (result.compareTo(threshold) >= 0) {
            System.out.println("恭喜，您已获得打印洗车票的服务！");
        }else {
            System.out.println("抱歉，您没有获得打印洗车票的服务！");
        }
        System.out.println("支付金额: " + result);

        return result;
    }


}
